Skip to content

refactor: phase 2 — pipeline orchestrator in TypeScript#44

Merged
georgewrmarshall merged 1 commit intomainfrom
pipeline-orchestrator
Apr 15, 2026
Merged

refactor: phase 2 — pipeline orchestrator in TypeScript#44
georgewrmarshall merged 1 commit intomainfrom
pipeline-orchestrator

Conversation

@georgewrmarshall
Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall commented Apr 10, 2026

Summary

Phase 2 of the pipeline re-architecture. Introduces TypeScript + tsx for all new pipeline code and replaces the fragmented yarn scripts with a single ordered orchestrator.

  • pipeline/run.ts — single entry point that runs all stages in strict order; fails fast on any error; supports --date for backfill and --only stage1,stage2 for debugging
  • pipeline/update-timeline.ts — TypeScript port of scripts/update-timeline.js; removes the retired migration-targets publishing
  • pipeline/validate.ts — TypeScript port of scripts/validate-metrics-consistency.js
  • pipeline/types.ts — shared interfaces for config, metrics data, timeline, and index shapes (aligned with dashboard/src/types/metrics.ts)
  • TypeScript toolingtsx + typescript devDependencies; tsconfig.json; Yarn PnP SDK for type checking (yarn typecheck)
  • CI simplified — single yarn pipeline step replaces 6 individual steps (sync-config, scan extension, scan mobile, update-timeline, validate, discover untracked)

Deleted

  • scripts/update-timeline.js → replaced by pipeline/update-timeline.ts
  • scripts/validate-metrics-consistency.js → replaced by pipeline/validate.ts
  • scripts/run-metrics.js → superseded by orchestrator

Test plan

  • yarn typecheck passes with no errors
  • yarn tsx pipeline/validate.ts passes against existing metrics data
  • yarn tsx pipeline/update-timeline.ts regenerates timeline.json and index.json correctly
  • yarn pipeline --only validate runs only the validate stage
  • CI workflow runs yarn pipeline as a single step

After

No visual changes to dashboard

after720.mov

@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 10, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​node@​25.5.21001008196100
Addedtsx@​4.21.01001008185100
Addedtypescript@​6.0.2100100909990

View full report

@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 10, 2026

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Warn Low
Potential code anomaly (AI signal): npm tsx is 100.0% likely to have a medium risk anomaly

Notes: This fragment appears to be a bundler-generated bootstrap/initialization piece that imports many modules and executes an initialization function (r). No explicit malicious activity is evident within this fragment itself, but the risk stems from side effects of the imported modules on load. A careful review of the implementations of the imported modules (especially those exporting r and those performing initialization, build-time, or network/file operations) is recommended to rule out hidden telemetry, backdoors, or undesired side effects.

Confidence: 1.00

Severity: 0.60

From: package.jsonnpm/tsx@4.21.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/tsx@4.21.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm tsx is 100.0% likely to have a medium risk anomaly

Notes: This module installs signal handlers and actively hides them from inspection by monkeypatching listener inspection APIs. In the main thread it can forward SIGINT/SIGTERM events to a remote client (via client.connectingToServer) and may exit the process after forwarding. The concealment is a noteworthy red flag: it makes detection and auditing harder and may be used to implement covert telemetry or control. The file alone is not conclusively malicious, but the combination of hiding handlers and forwarding signals to an external component warrants careful review of the client module (client-D6NvIMSC.cjs) and any network destinations it uses before trusting this package in sensitive environments.

Confidence: 1.00

Severity: 0.60

From: package.jsonnpm/tsx@4.21.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/tsx@4.21.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm tsx is 100.0% likely to have a medium risk anomaly

Notes: The module installs hidden signal handlers for SIGINT and SIGTERM, hides them from other code by monkey-patching process.listenerCount and process.listeners, forwards signals to an external client callback, and may force exit. That stealthy interception of process signals is suspicious from a supply-chain/security perspective because it can be used to intercept or suppress normal shutdown behavior and to forward events to another module which may perform network I/O or exfiltration. There is no direct evidence in this file of data exfiltration, reverse shell, or explicit malicious payload, but the hiding behavior and delegation to an external client warrant caution and further inspection of the imported client and cjs modules. Recommend auditing the client callback and cjs/index.cjs for network operations or data-leaking behavior before trusting this package.

Confidence: 1.00

Severity: 0.60

From: package.jsonnpm/tsx@4.21.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/tsx@4.21.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm tsx is 100.0% likely to have a medium risk anomaly

Notes: No clear indicators of classic malware (no reverse shell, no network connections, no child_process usage, no hard-coded credentials). The primary risk is information leakage: the loader posts module load events and dependency paths to external consumers via p.port and O.send. In contexts where those channels are controlled by an untrusted or remote party, this could leak local file paths or project structure. The module otherwise performs expected loader duties (file reads, tsconfig handling, transforming CJS to ESM, returning data: URLs). Review runtime consumers of O and any provided p.port to ensure they are trusted before using this loader in a sensitive environment.

Confidence: 1.00

Severity: 0.60

From: package.jsonnpm/tsx@4.21.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/tsx@4.21.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Introduces TypeScript + tsx for all new pipeline code and replaces
the fragmented yarn scripts with a single ordered orchestrator.

Added:
- pipeline/types.ts — shared TypeScript interfaces for config, metrics,
  timeline and index data shapes
- pipeline/update-timeline.ts — ported from scripts/update-timeline.js;
  removes migration-targets publishing (retired in phase 1)
- pipeline/validate.ts — ported from scripts/validate-metrics-consistency.js
- pipeline/run.ts — orchestrator with --date and --only flags; runs all
  stages in strict order and fails fast on any error
- tsconfig.json — TypeScript config for pipeline/ with Yarn PnP typeRoots
- .yarn/sdks/ — Yarn TypeScript SDK for PnP-aware type checking

Updated:
- package.json — adds yarn pipeline, yarn typecheck scripts; tsx/typescript
  as devDependencies
- CI workflow — single "yarn pipeline" step replaces 6 individual steps

Deleted:
- scripts/update-timeline.js (replaced by pipeline/update-timeline.ts)
- scripts/validate-metrics-consistency.js (replaced by pipeline/validate.ts)
- scripts/run-metrics.js (superseded by orchestrator)
@georgewrmarshall georgewrmarshall self-assigned this Apr 14, 2026
@georgewrmarshall georgewrmarshall merged commit fdbc41d into main Apr 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants